package gases.as3.librarys.core.net.cpp.struct
{
	public class StructElement extends Object
	{
		
		/**
		 * 依次分别为需要添加的Key,type类型
		 * @param name
		 * @param type
		 * @param value
		 * @param length
		 * 
		 */		
		public function StructElement(name:String, type:String, value:* ,length:int = 0)
		{
			_name = name;
			_type = type;
			_value = value;
			_length = length;
		}
		
		public function get value():*
		{
			return _value;
		}

		public function set value(value:*):void
		{
			_value = value;
		}

		public function get length():int
		{
			return _length;
		}

		public function set length(value:int):void
		{
			_length = value;
		}

		public function get type():String
		{
			return _type;
		}

		public function set type(value:String):void
		{
			_type = value;
		}

		public function get name():String
		{
			return _name;
		}

		public function set name(value:String):void
		{
			_name = value;
		}
		
		public function dispose():void
		{
			if(_value is Struct)
				Struct(_value).dispose();
			_value = null;
		}
		
		private var _name:String;
		private var _type:String;
		private var _length:int;
		private var _value:*;
	}
}